<% content_for :thredded_page_title, t('thredded.messageboard_group.show.page_title', name: @group.name) %>
<% content_for :thredded_page_id, 'thredded--messageboard-groups--index' %>
<% content_for :thredded_breadcrumbs, render('thredded/shared/breadcrumbs') %>
<%= thredded_page do %>
  <%= define_svg_icons('thredded/follow.svg', 'thredded/lock.svg') %>
  <%= view_hooks.messageboard_group_show.container.render self, groups: @groups do %>
    <section class="thredded--main-section thredded--messageboards">
      <%= view_hooks.messageboard_group_show.list.render self, groups: @groups do %>
        <% @groups.each do |group| %>
          <% if group.name.present? %>
            <h3 class="thredded--messageboards-group--title">
              <%= link_to group.name,
                          show_messageboard_group_path(group.id),
                          class: 'thredded--link' %>
            </h3>
          <% end %>
          <div class="thredded--messageboards-group">
            <%= view_hooks.messageboard_group_show.group.render self, group: group do %>
              <%= render partial: 'thredded/messageboards/messageboard',
                         collection: group.messageboards %>
            <% end %>
            <%= render partial: 'thredded/messageboards/grid_sizers' %>
          </div>
        <% end %>
      <% end %>

      <div class="thredded--messageboards--actions">
        <% if policy(Thredded::Messageboard.new).create? %>
          <a class="thredded--button" href="<%= new_messageboard_path %>" rel="nofollow">
            <%= t('thredded.messageboard.create') %>
          </a>
        <% end %>
        <% if policy(Thredded::MessageboardGroup.new).create? %>
          <a class="thredded--button" href="<%= new_messageboard_group_path %>" rel="nofollow">
            <%= t('thredded.messageboard_group.create') %>
          </a>
        <% end %>
      </div>
    </section>
  <% end %>
<% end %>
